//
//  YTSexView.m
//  yitaicaijing
//
//  Created by DIANGHONG on 2018/7/25.
//  Copyright © 2018年 DIANGHONG. All rights reserved.
//

#import "YTSexView.h"
@interface YTSexView()

@property(nonatomic ,strong)UIButton *currentBtn; // 记录当前选中按钮
@end
@implementation YTSexView

- (IBAction)cancelButtonClick:(UIButton *)sender
{
    [self hideInController];
}

// 性别按钮监听
- (IBAction)sexButtonClick:(UIButton *)sender
{
    self.currentBtn.selected = NO;
    sender.selected = YES;
    self.currentBtn = sender;
    
}

// 确定按钮 监听
- (IBAction)comfirmButtonClick
{
    if (!self.currentBtn) {
        return;
    }
    NSAssert(self.selectedSexBlock != nil, @"selectedSexBlock 不能为nil");
    self.selectedSexBlock(self.currentBtn.tag);
    
    [self cancelButtonClick:nil];
}



- (void)awakeFromNib
{
    [super awakeFromNib];
    
    self.layer.masksToBounds = YES;
    self.layer.cornerRadius = 10;
}

@end
